import axios from "@/utils/request.js";

/**
 * 添加新闻
 * @param {*} newsInfo 
 * @returns 
 */
export const newsAddService = (newsInfo) => {
    return axios.post("/newsInfo/add",newsInfo)
}

/**
 * 分页查询新闻信息
 * @param {*} pageNo 
 * @param {*} pageSize 
 * @param {*} titleFuzzy 
 * @returns 
 */
export const newsSelectService = (pageNo,pageSize,titleFuzzy) => {
    return axios.get("/newsInfo/loadDataList",{params:{
        pageNo,pageSize,titleFuzzy
    }})
}

/**
 * 根据newsId修改新闻信息
 * @param {*} newsInfo 
 * @returns 
 */
export const newsModifyService = (newsInfo) => {
    return axios.put("/newsInfo/updateNewsInfoByNewsId",newsInfo)
}

/**
 * 根据newsId删除新闻信息
 * @param {*} newsId 
 * @returns 
 */
export const newsDeleteService = (newsId) => {
    return axios.delete("/newsInfo/deleteNewsInfoByNewsId",{params:{
        newsId
    }})
}